home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / boot / bind_namesii.lha / AssignNode.h < prev    next >
C/C++ Source or Header  |  1995-07-27  |  3KB  |  74 lines

  1. /* $Header: Src/rcs/AssignNode.h,v 1.4 1995/06/21 17:24:04 cmh Exp cmh $
  2.  *
  3.  * BindNamesII: Handy assign/path maker.
  4.  * Copyright (C) 1994-95  Magnus Holmgren <cmh@augs.se>
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  */
  20.  
  21. #include <exec/types.h>
  22.  
  23. /* This structure stores one target for an assign.
  24.  * We use a struct Node so that names may prioritized.
  25.  * That way it is easy to specify search order priorities.
  26.  *
  27.  */
  28. struct PathNode
  29. {
  30.     struct Node        Node;           /* Node linking */
  31.     STRPTR            Name;           /* Path for this target */
  32.     struct AssignNode    *Parent;    /* Parent assign, if any */
  33. };
  34.  
  35.  
  36. /* This structure stores all information about an assign.
  37.  *
  38.  * We don't store any childrens here, since each part in a mulitassign can
  39.  * refer to a different parent. This forces us to backtrace the parents, which
  40.  * makes it a bit tricky to notice loops. But thanks to recursion it isn't
  41.  * that bad really.. :)
  42.  */
  43. struct AssignNode
  44. {
  45.     struct MinNode    Node;        /* Node linking */
  46.     struct MinList    Path;        /* The targets for this assign */
  47.     STRPTR        Name;        /* Name of this assign, including a ':' char */
  48.     STRPTR        Alias;        /* PathHandler alias for this assign */
  49.     WORD        AssignType;    /* Type of assign. ASN_NORMAL, ASN_DEFER or ASN_PATH */
  50.     WORD        Flags;        /* Various flags. See below */
  51.     LONG        IoErr;        /* Only used if ANF_FAILED is set */
  52. };
  53.  
  54. /* Type of assign */
  55.  
  56. #define ASN_NORMAL    0        /* Normal assign */
  57. #define ASN_DEFER    1        /* Resolve at first reference */
  58. #define ASN_PATH    2        /* Resolve at each reference */
  59. #define ASN_CMDPATH    3        /* Not assign, add to command search path instead */
  60.  
  61. /* AssignNode flags */
  62.  
  63. #define ANF_ADD        0x0001    /* Don't replace any previous assign */
  64. #define ANF_PATHADD    0x0002    /* Put all targets in a PathHandler assign, if there is at least one */
  65. #define ANF_ASSIGNED    0x0004    /* This assign have been done. */
  66. #define ANF_NODE    0x0008    /* This assign refers to a (not yet done) assign. I.e., it has at least one parent */
  67. #define ANF_VOLUME    0x0010    /* This assign only refers to known volumes (i.e. it can be assigned right away) */
  68. #define ANF_STRAY    0x0020    /* This assign refers (possibly indirect) to unknown volumes */
  69. #define ANF_FAILED    0x0040    /* This assign couldn't be made for some reason. See IoErr field for more info */
  70. #define ANF_LOOP    0x0080    /* This assign is in a loop that can't be resolved */
  71. #define ANF_BAD        0x0100    /* This assign is bad somehow (probably multiple targets for ASN_DEFER or ASN_PATH) */
  72. #define ANF_VISIT    0x0200    /* This node have already been visited by IsStray(). For loop detection */
  73. #define ANF_BADPARENT    0x0400    /* This assign node couldn't be made becase a parent assign had failed */
  74.